#!/bin/sh /etc/rc.common                                                                                                                                                                                                                             
# Copyright (C) 2006-2011 OpenWrt.org                                                                                                                                                                                                                
                                                                                                                                                                                                                                                     
START=99                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                     
SERVICE_USE_PID=1                                                                                                                                                                                                                                    
SERVICE_WRITE_PID=1                                                                                                                                                                                                                                  
SERVICE_DAEMONIZE=1                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                     
start() {                                                                                                                                                                                                                                            
    while :                                                                                                                                                                                                                                          
    do                                                                                                                                                                                                                                               
    ping -c 1 li.yunlink.win                                                                                                                                                                                                                         
    if [ $? -eq 0 ]                                                                                                                                                                                                                                  
    then                                                                                                                                                                                                                                             
      break                                                                                                                                                                                                                                          
    fi                                                                                                                                                                                                                                               
    done                                                                                                                                                                                                                                             
    service_start  /usr/bin/npc -server=li.yunlink.hn.cn:8024 -vkey=taiweilong -type=tcp & 2>/dev/null                                                                                                                                                   
}                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                     
stop() {                                                                                                                                                                                                                                             
    service_stop /usr/bin/npc                                                                                                                                                                                                                        
}            